package rs.pnv.bank;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

import javax.jws.HandlerChain;
import javax.jws.WebService;

import rs.pnv.model.card.CardInformation;
import rs.pnv.model.payment.PaymentUrl;
import rs.pnv.model.payment.PaymentUrlRequest;
import rs.pnv.model.response.BankAut;
import rs.pnv.model.response.IssuerResponse;

@WebService(endpointInterface = "rs.pnv.bank.Bank")
@HandlerChain(file = "/handler-chain.xml")
public class BankImpl implements Bank {

	@Override
	public PaymentUrl processPaymentUrlRequest(PaymentUrlRequest paymentUrlRequest) {
		System.out.println("Poruka je primljena!");
		System.out.println(paymentUrlRequest.getErrorUrl());
		System.out.println(paymentUrlRequest.getMerchant().getMerchantId());
		System.out.println(paymentUrlRequest.getMerchant().getMerchantPassword());
		PaymentUrl paymentUrl = new PaymentUrl();
		paymentUrl.setId(new Long(1));
		paymentUrl.setPaymentUrlId(new BigInteger("1"));
		paymentUrl.setTimestamp(new Date());
		paymentUrl.setUrl("PAYMENT_URL");
		return paymentUrl;
	}

	@Override
	public IssuerResponse processAcquirerAut(BankAut acquirerAut, CardInformation cardInformation, BigDecimal amount) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public IssuerResponse processIssuerAut(BankAut issuerAut, CardInformation cardInformation, BigDecimal amount) {
		// TODO Auto-generated method stub
		return null;
	}

}
